## 开始游戏(此函数不会重置地图,若要重置,请使用vs:system/game/reset_load/start)

scoreboard players reset game_loading system
scoreboard players set #startTrigger temp 1

#SpawnCtrol
function vs:system/game_ctrol/spawn

#Minecart
execute as @e[tag=Minecart,type=minecart] at @s unless score @s StreamMinecart matches -2147483648..2147483647 run scoreboard players set @s StreamMinecart 0

#Player
effect give @a regeneration 10 255 true
effect give @a saturation 10 255 true
tag @a remove inconfig
tag @a remove config
scoreboard players set @a PlayerKill 0
scoreboard players set @a KillReward 0
scoreboard players reset @a Death
execute as @a[tag=!dontJoinGame] at @s run function vs:system/game/player_start

#System Score
scoreboard players set game_run system 1


scoreboard objectives setdisplay list KillReward
scoreboard objectives setdisplay below_name HP

#Stream
function vs:system/game_ctrol/void_stream/stream_change

#devour coming
scoreboard players set devour_coming system 36000
scoreboard players operation devour_coming_seconds TimeToTick = devour_coming system
execute store result bossbar devour_coming max run scoreboard players operation devour_coming_seconds TimeToTick /= 20 number

#bossbars
bossbar set game_starting players
bossbar set devour_coming players @a
bossbar set vs:blue_stream_barrier_hp players @a[team=blue]
bossbar set vs:red_stream_barrier_hp players @a[team=red]
bossbar set vs:blue_stream_barrier_hp color blue
bossbar set vs:red_stream_barrier_hp color blue
execute store result bossbar vs:blue_stream_barrier_hp max run function vs:system/game/rules/get_value {index:{id:"stream_barrier_spawner_max_health"}}
execute store result bossbar vs:blue_stream_barrier_hp value run function vs:system/game/rules/get_value {index:{id:"stream_barrier_spawner_max_health"}}
execute store result bossbar vs:red_stream_barrier_hp max run function vs:system/game/rules/get_value {index:{id:"stream_barrier_spawner_max_health"}}
execute store result bossbar vs:red_stream_barrier_hp value run function vs:system/game/rules/get_value {index:{id:"stream_barrier_spawner_max_health"}}

function vs:tips/all/send {message:{"text":"虚空的状态并不稳定，请尽快返航!","color":"red"},style:'"bold":true'}

scoreboard players reset #startTrigger temp